.NET Version Note

If you are using .NET 5 or .NET 2, you must also add one these lines in the example below

Javascript

keyotiSearch.setServiceType('core'); //for .NET 5

keyotiSearch.setServiceType('asmx'); //for .NET 2

Spelling Suggestions ("Did you mean?") - Pro version

The default result header template will display spelling suggestions for misspelled search queries.

HTML
    ...
    <div id="sew_resultHeader">                   
        <div id="sew_headerTEMPLATE" class="sew_header">
            Showing result page <b>${PageNumber}</b>. 
            There are <b>${NumberOfResults}</b> results for <b>&#8220;${Query}&#8221;</b>. 
            <span id="sew_ignoredWords">The following common words were ignored: ${IgnoredWords}</span>
            <div id="sew_didYouMean">Did you mean: <a href="#stayhere" 
                    onclick="keyotiSearch.search(\'${SuggestedSearchExpressionEscaped}\', 1)">${SuggestedSearchExpression}</a></div>
        </div>               
    </div>
    ...

It is important to wrap the 'did you mean' section with an element with id sew_didYouMean, because this element is automatically made invisible if there are no misspelled words.

${SuggestedSearchExpressionEscaped} is a Javascript safe string (ie. escaped quotes) containing the corrected search query.

${SuggestedSearchExpression} is the corrected search query.

Language

Installation of Additional Language Dictionaries

Download and unzip the .dict file(s) required and place it in a folder under the Index Directory called "Dictionaries" (creating if need be). For example - myApp\IndexDirectory\Dictionaries\DICT-DE-DE-German_SE.dict. The dictionary files must not be renamed, as their language is determined from the filename.

Multiple global dictionaries are available for free download, once installed a language can be selected using the keyotiSearch.language property.

HTML
    keyotiSearch.language = "EnglishUS";

Valid language strings are as the values defined in the enum Keyoti.SearchEngine.Suggestions.LanguageType: Danish, Dutch, English, EnglishAustralia, EnglishCanada, EnglishMedical, EnglishUK, EnglishUS, French, German, Italian, Norwegian, Polish, Portuguese, Spanish, SpanishLatinAmerica, Swedish, Russian, Custom

When set to "Custom" the spell checker will attempt to load a dictionary file under the Dictionaries folder named DICT-X-X-Custom_SE.dict

Custom Dictionary Wordlists

It is common for web-sites and users to use words that are not in the standard dictionary, typically this includes organizational names, acronyms and jargon. To avoid having these terms queried to the user on searches, add them to a text file (eg. "custom_dictionary.txt") and place that file on the server. Set keyotiSearch.customDictionaryPath to point to 'custom_dictionary.txt' (this is relative to the indexDirectory\Dictionaries\ folder). The terms used in the text file will supplement the dictionary, both for known words and for suggestions. It is recommended that all legal forms of the word are added, and added in lowercase, eg;

keyoti

keyoti's

rapidspell

Spell Suggestion Source

Where the spelling suggestions will be sourced, options are defined in the Keyoti.SearchEngine.Suggestions.SpellingSuggestionSource enum (eg. PresetDictionary, SearchLexicon, PresetDictionaryAndOptionalSearchLexicon, PresetDictionaryAndSearchLexicon). Care should be taken with lexicon based options as large lexicons can cause slow downs.

HTML
    keyotiSearch.spellingSuggestionSource = "PresetDictionary";